﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Drempelvrij.Models
{
    public abstract class EntityBase<TId>
    {
        public virtual TId Id { get; set; }

        public override bool Equals(object entity)
        {
            return entity != null
                && entity is EntityBase<TId>
                && this == (EntityBase<TId>)entity;
        }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }
    }
}
